import request from '@/utils/request'
import da from 'element-ui/src/locale/lang/da'
import { exportRole } from './role'
import store from '../../store'
// 查询参数列表
// 新增参数配置

//班期列表
export function classinfos(data) {
    return request({
        url: 'business/class/list',
        method: 'post',
        params: data
    })
}
//学校列表
export function getschoollist(data) {
  return new Promise(resolve => {
    const response=store.state.school.cacheData
    resolve(response)
  })
}
//根据学校id查询班期名称
export function getclasslist(data) {
    return request({
        url: '/business/class/selectClassById',
        method: 'post',
        data: data
    })
}

//专业
export function majorlist(data) {
    return request({
        url: '/business/class/selectProfessional',
        method: 'post',
        data: data
    })
}

//摄像头信息
export function selectCamera(){
  return request({
    url: '/business/cameraInfo/selectCameraInfo',
    method: 'post'
  })
}

//删除
export function deletes(data) {
    return request({
        url: '/business/class/delete',
        method: 'post',
        data: data
    })
}

//新增班期
export function newadd(data) {
  console.log("-------------")
  console.log(data)
  console.log("-------------")
    return request({
        url: '/business/class/add',
        method: 'post',
        data: data
    })
}

//修改班期
export function changeclass(data) {
    return request({
        url: '/business/class/alter',
        method: 'post',
        data: data
    })
}

//修改显示数据
export function showchangedata(data) {
    return request({
        url: '/business/class/selectBizClassById',
        method: 'post',
        data: data
    })
}

// 审核提交的弹框回显
export function selectClassAuditInfo(data) {
    return request({
        url: '/system/audit/selectClassAuditInfo',
        method: 'post',
        data: data
    })
}

//提交审核
// 审核提交的弹框回显
export function add(data) {
    return request({
        url: '/system/audit/add',
        method: 'post',
        data: data
    })
}

export function selectClassTime(data) {
  return request({
    url: '/business/class/selectClassTime',
    method: 'post',
    data: data
  })
}

//排课表格
export function classTimeListById(data) {
    return request({
      url: '/business/class/classTimeListById',
      method: 'post',
      data: data
    })
  }

// 班级详细信息
export function classDetail(data) {
    return request({
      url: '/business/class/list',
      method: 'post',
      data: data
    })
  }


  //排课提交
export function editClassTimeList(data) {
    return request({
      url: '/business/class/editClassTimeList',
      method: 'post',
      data: data
    })
  }


    // 排课信息
export function scheduleList(data) {
  return request({
    url: '/business/class/selectByClassId',
    method: 'post',
    data: data
  })
}
// export function templateList(data) {
//   return request({
//     url:'/system/message/list',
//     method:'get',
//     data: data
//   })
// }


//排课模板
export function template(data) {
  return request({
    url: 'system/message/list',
    method: 'get',
    data: data
  })
}

//新增排课模板
export function message(data) {
  return request({
    url: '/system/message/add',
    method: 'post',
    data: data
  })
}


export function templateList(data) {
  return request({
    url:'/system/message/list',
    method:'get',
    data: data
  })
}

// 教师列表
export function selectTeacherList(data) {
  return request({
    url:'/business/class/selectTeacherListBySchool',
    method:'post',
    data: data
  })
}

// 导出结业证书pdf
export function ExportReport(data) {
  return request({
    url:'/business/class/pdf',
    method:'post',
    data: data,
    responseType: 'blob'
  })
}
// 导出考勤详情excel
export function excelclass(data) {
  return request({
    url:'/business/class/excel',
    method:'post',
    data: data,
    responseType: 'blob'
  })
}

// 排课模板学校列表
export function getAllDepartmentName(query) {
  return request({
    url:'/system/message/getAllDepartmentName',
    method:'GET',
    params: query
  })
}
//当前学校的摄像头
export function getcamerabyschool(query) {
  return request({
    url:'/business/cameraInfo/selectCameraInfo',
    method:'GET',
    params: query
  })
}
//获取专业期次
export function selectProfessional(query) {
  return request({
    url:'/business/professional/selectProfessionalByDeptIdCount',
    method:'GET',
    params: query
  })
}
//查询当前学校的所有摄像头信息及状态
export function  selectBizCamrtaInfoByClassIdAndStatus(data) {
  return request({
    url:'/business/bizCameraInfo/selectBizCamrtaInfoByClassIdAndStatus',
    method:'post',
    params: data
  })
}

export function updateCamrtaInfoByClassId(data) {
    return request({
      url:'/business/bizCameraInfo/updateCamrtaInfoByClassId',
      method:'post',
      params:data
    })
}
